package red_book.year2024.month9;

import java.util.Arrays;
import java.util.Scanner;

public class Mount {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = Integer.parseInt(scanner.nextLine());
        int[]arr=new int[n];
        if(n<3){
            System.out.println(n);
        }
        for(int i=0;i<n;i++){
            arr[i]=scanner.nextInt();
        }
        int []left=new int[n]; //递增
        int []right=new int[n]; //递减
        left[0]=1;
        right[n-1]=1;

        for(int i=1;i<n;i++){
            if(arr[i]>arr[i-1]){
                left[i]=left[i-1]+1;
            }else{
                left[i]=1;
            }
        }

        for(int i=n-2;i>=0;i--){
            if(arr[i]>arr[i+1]){
                right[i]=right[i+1]+1;
            }else{
                right[i]=1;
            }
        }
        int maxLen=1;
        for(int i=1;i<n;i++){
            if(left[i]+right[i]-1>maxLen){
                maxLen=left[i]+right[i]-1;
            }
        }
        System.out.println();
        for (int i : arr) {
            System.out.print(i+"");
        }
        System.out.println();
        for (int i:left){
            System.out.print(i+"");
        }
        System.out.println();
        for (int i:right){
            System.out.print(i+"");
        }
        System.out.println();

        System.out.println(maxLen);
    }
}
